#ifndef MYBALL_H
#define MYBALL_H
#include "Object.h"
#include "Box2D/Box2D.h"
#include <list>

const static int kAimSpriteTotalNumber = 5;
class CBucket;
class CBall : public CObject,public CCTargetedTouchDelegate
{
public:
	CBall();
	virtual ~CBall();

	virtual void onEnter();
	virtual void update(float dt);

	virtual void setPosition(const CCPoint& newPosition);
	virtual void setScale(float scale);
	virtual void setRotation(float fRotation);

	virtual bool ccTouchBegan(CCTouch* pTouch, CCEvent* pEvent);
	virtual void ccTouchMoved(CCTouch* pTouch, CCEvent* pEvent);
	virtual void ccTouchEnded(CCTouch* pTouch, CCEvent* pEvent);

	virtual void Load(CCDictionary* ballDic);
	BallState GetBallState();
	void SetBallState(BallState state);

	void ShootByBucket(CBucket* bucket);
	void BingoInBucket();
private:
	bool _isTouchPointInBall(CCTouch* pTouchPos);
	BallState									mBallState;
	std::list<CCSprite*>						mAimSpriteList;
};
inline void CBall::SetBallState(BallState state)
{
	mBallState  = state;
}
inline BallState CBall::GetBallState()
{
	return mBallState;
}


#endif